package com.tuproj.pizzaorder;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class LoginActivity extends Activity {

	private EditText etUsername;
	private EditText etPassword;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		etUsername = (EditText) findViewById(R.id.etUsername);
		etPassword = (EditText) findViewById(R.id.etPassword);
	}

	public void logIntoSystem(View v) {
		
		//Databases.
		boolean isPasswordCorrect = "a".equals(etUsername.getText()
				.toString()) && "a".equals(etPassword.getText().toString());

		if (isPasswordCorrect) {
			Intent intent = new Intent(this,BaseActivity.class);
			startActivity(intent);
		} else {

			(Toast.makeText(
					getApplicationContext(),
					"Username,password or both are incorrect.Please try Again!",
					Toast.LENGTH_SHORT)).show();
		}

	}
}
